import { Injectable, PipeTransform } from "@nestjs/common";

/**
 * page 转换为 start (在被路由处理方法接收之前)
 */
@Injectable()
export class PageSatrtPipe implements PipeTransform {
  transform(value: any) {

    // 转换page
    value.start = (value.page - 1) * value.limit

    return value
  }
}